<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title>AJAX</title>
	<script type="text/javascript" src="js/jquery-1.7.1.js"></script>
</head>
<body>
	<input type="text" name="fruit" id="fruit" />
	<button>Search</button>
	<div id="data">
	</div>
	<script type="text/javascript">
		$('button').click(function(event){
			//$('#fruit').val();
			$.ajax({
				url: 'http://localhost/iconnect-training/jquery/ajax-data/data.php',
				data: {fruit: $('#fruit').val(), other: 'test'},
				type: 'POST',
				dataType: 'html',
				success: function(result) {
					$('#data').html(result);
				}
				
			});
		});
	</script>
</body>
</html>